package com.example.api.mapper;

import com.example.api.model.entity.Commodity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface CommodityMapper {

    void insert(Commodity commodity);

    void update(Commodity commodity);

    void deleteById(@Param("id") String id);

    Commodity findById(@Param("id") String id);

    List<Commodity> findAll();

    List<Commodity> findByNameLike(@Param("name") String name);

    // 新增方法
    void updateCount(@Param("id") String id, @Param("count") Integer count);
}
